package com.ryan.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author raofy
 * @date 2021-09-24 11:24
 * @desc
 */
@RestController
@RequestMapping("server")
public class ServerPortController {

    @Value("${server.port}")
    private String port;

    /**
     * 编写返回当前实例端口号
     *
     * @return
     */
    @GetMapping("port")
    public String findServerPort() {
        try{
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return port;
    }
}
